package com.ae.base;

import com.ae.api.IPlaced;

import java.util.HashMap;

/**
 * 一个简单的模型注册器
 * 可以直接在主类加载时注册，也可以单独找个地方注册，但一定要在主类中调用过
 */
public class PlacedRegister {
    public static final HashMap<String, IPlaced> placedMap = new HashMap<>();

    public static void register(IPlaced placed) {
        if (placedMap.containsKey(placed.getId())) {
            throw new IllegalArgumentException("ID已存在！  ID repeat!");
        }

        placedMap.put(placed.getId(), placed);
    }
}
